package com.baway.common.provider

import android.content.Context
import com.tencent.mmkv.MMKV

/**
 * Author: Jason Zhang
 * Date: 2025/8/19
 * Desc: 提供基本服务
 */

abstract class BaseServiceProvider: IBaseServiceProvider {

    private lateinit var mContext: Context

    override fun init(context: Context?) {
        context?.let {
            mContext = it
        }
    }

    override fun checkLoginState(): Boolean {
        val loginToken = MMKV.defaultMMKV().decodeString("token", "").toString()
        if (!loginToken.isNullOrEmpty()){
            return true
        }
        return false
    }

    override fun getLoginToken(): String {
       return MMKV.defaultMMKV().decodeString("token", "").toString()
    }

}